home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PPC1B3AA.ZIP / MOVETO.PPS < prev    next >
Text File  |  1996-08-29  |  1KB  |  46 lines

  1. ;----------------------------------------------------------------------------
  2. ; Copyright(C) 1996, The AEGiS Corporation
  3. ;----------------------------------------------------------------------------
  4. ;
  5. ; PROCEDURE MoveTo()
  6. ;
  7. ; Replacement for AnsiPos
  8. ;
  9. ; Unlike AnsiPos, MoveTo will move cursor relativly to its current position
  10. ; this meens that it will not destruct 50 lines terminal users screen (which
  11. ; ansipos do)
  12. ;
  13. ;----------------------------------------------------------------------------
  14. #lib
  15. #nouser
  16.  
  17. Declare Procedure MoveTo(Int AnsiPosX, Int AnsiPosY)
  18.  
  19. Procedure MoveTo(Int AnsiPosX, Int AnsiPosY)
  20.  
  21. Integer CurX
  22. Integer CurY
  23. Integer LinesUp
  24. Integer LinesHor
  25.  
  26. CurX = getX()
  27. CurY = getY()
  28. LinesUp = CurY - AnsiPosY
  29. LinesHor = CurX - AnsiPosX
  30. If (LinesUp = 0) Goto endX
  31. If (LinesUp > 0) Then
  32.     Print Chr(27)+"["+I2s(LinesUp,10)+"A"
  33. Else
  34.     Print Chr(27)+"["+I2s((0-LinesUp),10)+"B"
  35. End If
  36. :endX
  37. If (LinesHor = 0) Goto endY
  38. If (LinesHor > 0) Then
  39.     Print Chr(27)+"["+I2s(LinesHor,10)+"D"
  40. Else
  41.     Print Chr(27)+"["+I2s((0-LinesHor),10)+"C"
  42. End If
  43. :endY
  44.  
  45. EndProc
  46.